<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>TZ-追梦</title>
    <style>
        * {
            margin: 0;
            padding: 0;
        }
    </style>
</head>
<body>
<input type="button" id="btn" value="生成">
<div id="box"></div>
    <script>
        btn.onclick = function () {
            console.time(1);
            var num = 20000;
            var str = '';
            for(var i=0;i<num;i++){
                str+= String.fromCharCode(i);
            };
            box.innerHTML= str;
            console.timeEnd(1)
        }
    </script>
</body>
</html>